package com.qf;

import com.qf.xml.dao.UserDao;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class AppMain {
    public static void main(String[] args) {

        //获取spring的ioc容器对象(底层就是一个工厂对象)
        ApplicationContext ioc = new ClassPathXmlApplicationContext("application-di.xml");

        //从spring容器中获取我们想要的对象
//        UserService userservice = (UserService) ioc.getBean("userService");
//
//        userservice.findAll();

        UserDao userDao2 = (UserDao) ioc.getBean("userDao2");
        System.out.println(userDao2);
    }
}
